package models

import "database/sql"

var Models = []interface{}{
	&User{},
}

// 这个放的是数据库表的公共字段
type Model struct {
	Id         int64 `gorm:"primaryKey;autoIncrement" json:"id" form:"id"`
	CreateTime int64 `json:"createTime" form:"createTime"`
	UpdateTime int64 `json:"updateTime" form:"updateTime"`
}

type User struct {
	Model
	Account  string         `gorm:"size:128;" json:"account" form:"account"`
	UserName sql.NullString `gorm:"size:128" json:"userName" form:"userName"`
	Password string         `gorm:"size:128" json:"password" form:"password"`
	Salt     string         `gorm:"size:128" json:"salt" form:"salt"`
	Age      uint16         `json:"age" form:"age"`
	Sex      sql.NullString `gorm:"size:1" json:"sex" form:"sex"`
	ImageUrl sql.NullString `json:"imageUrl" form:"imageUrl"`
}
